<template>
  <div class="top-bar">
    <div class="container">
      <router-link to="/home"
                   class="brand">
        <img :src="logo"
             alt />
      </router-link>

      <a href="javascript:;"
         class="menu-bar pc-horizontal"
         data-target="#nt-menu"
         @click="isPhoneShow = !isPhoneShow">
        <span></span>
        <span></span>
        <span></span>
      </a>
      <el-drawer :visible.sync="isPhoneShow"
                 :before-close="handleClose"
                 :direction="'rtl'"
                 :show-close="false"
                 size="70%"
                 :wrapperClosable="true"
                 @touchmove.prevent>
        <div class="menus"
             :class="{ active: isPhoneShow, phoneShow: isPhoneShow }"
             id="nt-menu">
          <div class="btns topMain">
            <div v-if="!isShow"
                 class="btnGroups">
              <router-link to="/userLogin"
                           class="login">登录</router-link>
              <router-link to="/userregister"
                           class="register">注册</router-link>
            </div>
            <div v-else>
              <div class="right">
                <info></info>
              </div>
            </div>
          </div>
          <!-- <a v-if="!isShow"
             href="https://sh.zhubaba.cn/"
             target="_blank"
             class="link">商家版</a> -->
          <div class="links">
            <ul>
              <router-link @click.native="close()"
                           v-show="holdall"
                           to="/home"
                           tag="li">
                <img src="../assets/images/m/index01.png"
                     class="m-icon" />
                首页
              </router-link>
              <router-link @click.native="close()"
                           to="/qiming"
                           tag="li">
                <img src="../assets/images/m/qiming.png"
                     class="m-icon" />
                立即起名
              </router-link>
              <router-link @click.native="close()"
                           to="/price"
                           tag="li">
                <img src="../assets/images/m/jiage.png"
                     class="m-icon" />
                定价
              </router-link>
              <li v-show="holdall"
                  @click="vipClick()">
                <img src="../assets/images/m/vip.png"
                     class="m-icon" />
                会员
              </li>
              <!-- <router-link @click.native="isPhoneShow = !isPhoneShow" to="/holdall" tag="li">
								<img src="../assets/images/m/gongjuxiang.png" class="m-icon"/>
								工具箱
              </router-link>-->
              <el-collapse v-model="activeNames"
                           class="collapse"
                           @change="handleChange">
                <img src="../assets/images/m/gongjuxiang.png"
                     class="m-icon" />
                <el-collapse-item title="工具箱"
                                  name="1">
                  <div class="nav-item"
                       @click.stop="goToPage('/classic_input')">
                    <div>
                      <img :src="icon1"
                           alt />
                    </div>
                    <p>经典起名</p>
                  </div>
                  <div class="nav-item"
                       @click.stop="goToPage('/high_input')">
                    <div>
                      <img :src="icon2"
                           alt />
                    </div>
                    <p>高分起名</p>
                  </div>
                  <div class="nav-item"
                       @click.stop="goToPage('/select_author')">
                    <div>
                      <img :src="icon3"
                           alt />
                    </div>
                    <p>诗词起名</p>
                  </div>
                  <div class="nav-item"
                       @click.stop="goToPage('/wuxing_input')">
                    <div>
                      <img :src="icon4"
                           alt />
                    </div>
                    <p>五行字典</p>
                  </div>
                  <div class="nav-item"
                       @click.stop="goToPage('/search_name')">
                    <div>
                      <img :src="icon5"
                           alt />
                    </div>
                    <p>重名查询</p>
                  </div>
                  <div class="nav-item"
                       @click.stop="goToPage('/name_grade')">
                    <div>
                      <img :src="icon6"
                           alt />
                    </div>
                    <p>姓名打分</p>
                  </div>
                  <div class="nav-item"
                       @click.stop="goToPage('/birth_input')">
                    <div>
                      <img :src="icon7"
                           alt />
                    </div>
                    <p>生辰八字</p>
                  </div>
                  <div class="nav-item">
                    <div>
                      <img :src="icon8"
                           alt />
                    </div>
                    <p>更多工具</p>
                  </div>
                </el-collapse-item>
              </el-collapse>
              <router-link @click.native="close()"
                           to="/help"
                           tag="li">
                <img src="../assets/images/m/wendang.png"
                     class="m-icon" />
                文档
              </router-link>
              <router-link @click.native="close()"
                           to="/aboutus"
                           tag="li">
                <img src="../assets/images/m/guanyuwomen.png"
                     class="m-icon" />
                关于我们
              </router-link>
            </ul>
          </div>
          <!-- <div class="btns topMain">
						<div v-if="!isShow" class="btnGroups">
							<router-link to="/userLogin" class="login">登录</router-link>
							<router-link to="/userregister" class="register">注册</router-link>
						</div>
						<div v-else>
							<div class="right">
								<info></info>
							</div>
						</div>
					</div>
          <router-link v-if="!isShow" to="" class="link">商家版</router-link>-->
        </div>
      </el-drawer>

      <div class="menus aa"
           id="nt-menu">
        <div class="links">
          <ul>
            <router-link to="/home"
                         tag="li">首页</router-link>
            <router-link to="/qiming"
                         tag="li">立即起名</router-link>
            <router-link to="/price"
                         tag="li">定价</router-link>

            <router-link to="/holdall"
                         tag="li"
                         id="aa">
              工具箱
              <span>New</span>
              <i class="el-icon-arrow-down"></i>
              <div class="erjicaidan"
                   :class="{erjicaidan2:topBannerShow}">
                <div class="icon2">
                  <h5 @click.stop="goToPage('/classic_input')">
                    <div>
                      <img :src="icon1"
                           alt />
                    </div>
                    <p>经典起名</p>
                  </h5>
                  <h5 @click.stop="goToPage('/high_input')">
                    <div>
                      <img :src="icon2"
                           alt />
                    </div>
                    <p>高分起名</p>
                  </h5>
                  <h5 @click.stop="goToPage('/select_author')">
                    <div>
                      <img :src="icon3"
                           alt />
                    </div>
                    <p>诗词起名</p>
                  </h5>
                  <h5 @click.stop="goToPage('/wuxing_input')">
                    <div>
                      <img :src="icon4"
                           alt />
                    </div>
                    <p>五行字典</p>
                  </h5>
                  <h5 @click.stop="goToPage('/search_name')">
                    <div>
                      <img :src="icon5"
                           alt />
                    </div>
                    <p>重名查询</p>
                  </h5>
                  <h5 @click.stop="goToPage('/name_grade')">
                    <div>
                      <img :src="icon6"
                           alt />
                    </div>
                    <p>姓名打分</p>
                  </h5>
                  <h5 @click.stop="goToPage('/birth_input')">
                    <div>
                      <img :src="icon7"
                           alt />
                    </div>
                    <p>生辰八字</p>
                  </h5>
                  <h5>
                    <div>
                      <img :src="icon8"
                           alt />
                    </div>
                    <p>更多工具</p>
                  </h5>
                </div>
              </div>
            </router-link>
            <router-link to="/help"
                         tag="li">文档</router-link>
            <router-link to="/aboutus"
                         tag="li">关于我们</router-link>
          </ul>
        </div>

        <el-popover placement="bottom"
                    width="420"
                    trigger="hover"
                    v-model="visible"
                    :visible-arrow="false"
                    popper-class="vip-popper">
          <div class="vip-wrap">
            <p class="vip-title">开通VIP即可获得</p>
            <div class="vip-icon-box">
              <div class="vip-icon-item">
                <img :src="vipIcon1" />
                <p>海量数据</p>
              </div>
              <div class="vip-icon-item">
                <img :src="vipIcon2" />
                <p>无限使用</p>
              </div>
              <div class="vip-icon-item">
                <img :src="vipIcon3" />
                <p>数据分析</p>
              </div>
              <div class="vip-icon-item">
                <img :src="vipIcon4" />
                <p>1V1客服</p>
              </div>
            </div>
            <div class="vip-btn"
                 v-if="!show"
                 @click="openVip">立即开通</div>
            <div class="vip-date"
                 v-if="show">
              VIP到期时间：
              <span style="color: #F56C6C;">{{userInfo.vipEndTime | formatDate}}</span>
            </div>
            <!-- <div class="vip-btn" v-if="show">
							已开通
            </div>-->
          </div>
          <div class="vip-box"
               slot="reference"
               v-if="!show"
               @click="openVip">
            <img :src="vipIcon"
                 width="40px"
                 height="40px" />
          </div>

          <div class="vip-box"
               slot="reference"
               v-if="show">
            <img :src="vipIcon"
                 width="40px"
                 height="40px" />
          </div>
        </el-popover>

        <div class="btns topMain">
          <div v-if="!isShow"
               class="btnGroups">
            <router-link to="/userLogin"
                         class="login">登录</router-link>
            <router-link to="/userregister"
                         class="register">注册</router-link>
          </div>
          <div v-else>
            <div class="right">
              <info></info>
            </div>
          </div>
        </div>
        <!-- <a v-if="!isShow"
           href="https://sh.zhubaba.cn/"
           target="_blank"
           class="link">商家版</a> -->
      </div>
    </div>
  </div>
</template>

<script>
import mes from "@/assets/images/backstage/message.svg";
import logo from "@/assets/images/logo.png";
import info from "@/components/userInfo.vue";
import icon1 from "@/assets/images/icon1.png";
import icon2 from "@/assets/images/icon2.png";
import icon3 from "@/assets/images/icon3.png";
import icon4 from "@/assets/images/icon4.png";
import icon5 from "@/assets/images/icon5.png";
import icon6 from "@/assets/images/icon6.png";
import icon7 from "@/assets/images/icon7.png";
import icon8 from "@/assets/images/icon8.png";
import vipIcon from "@/assets/images/vip_icon.png";
import vipIcon1 from "@/assets/images/vip-icon1.png";
import vipIcon2 from "@/assets/images/vip-icon2.png";
import vipIcon3 from "@/assets/images/vip-icon3.png";
import vipIcon4 from "@/assets/images/vip-icon4.png";
import { mapState } from "vuex";
import { formatDate } from "@/util/util.js";
export default {
  filters: {
    formatDate (time) {
      var date = new Date(time);
      return formatDate(date, "yyyy年MM月dd日 hh:mm");
    }
  },
  components: {
    info
  },
  data () {
    return {
      holdall: true,
      activeNames: [],
      icon1,
      icon2,
      icon3,
      icon4,
      icon5,
      icon6,
      icon7,
      icon8,
      logo,
      vipIcon,
      vipIcon1,
      vipIcon2,
      vipIcon3,
      vipIcon4,
      visible: false,
      isPhoneShow: false,
      isShow: localStorage.getItem("key") ? true : false,
      isMegShow: true,
      userInfo: {},
      // show:false,
      mes,
      size: 28,
      circleUrl:
        "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
      texts: "",
      timea: null,
      list: [
        {
          id: 1001,
          avatar: "",
          isRead: false,
          text:
            "[公告] 近期变动消息，请抓紧调整近期变动消息，请抓紧调整近期变动消息。",
          time: "2019-10-10"
        },
        {
          id: 1002,
          avatar: "",
          isRead: false,
          text:
            "[公告] 近期变动消息，请抓紧调整近期变动消息，请抓紧调整近期变动消息。",
          time: "2019-10-10"
        },
        {
          id: 1003,
          avatar: "",
          isRead: false,
          text:
            "[公告] 近期变动消息，请抓紧调整近期变动消息，请抓紧调整近期变动消息。",
          time: "2019-10-10"
        }
      ],
      loginShow: false, //判断是否登录
      // topBanner: '', //判断头部banner是否显示
      topBannerShow: ''
    };
  },
  created () {
    let key = localStorage.getItem("key");
    let currentUrl = this.$route.path
    if (currentUrl == '/home' && this.topBanner) {
      this.topBannerShow = true
    } else {
      this.topBannerShow = false
    }
    if (key) {
      this.loginShow = true;
      let userInfo = JSON.parse(sessionStorage.getItem("info"));
      let nowDate = new Date().getTime();
      if (userInfo) {
        if (userInfo.vipEndTime > nowDate) {
          this.userInfo = userInfo;
          // this.show = true
          this.$store.commit("show", true);
        } else {
          this.userInfo = {};
          // this.show = false
          this.$store.commit("show", false);
          this.timers();
        }
      } else {
        this.timers();
      }
    } else {
      this.loginShow = false;
      // this.show = false
      this.$store.commit("show", false);
    }
  },
  computed: {
    //报错
    // ...mapState(["show"]),
    show: {
      get () {
        return this.$store.state.show;
      },
      set (val) {

      }
    },
    topBanner () {
      return this.$store.state.topBannerShow;
    }
  },
  watch: {
    topBanner: {
      handler: function (val) {
        if(val){
          this.topBannerShow = true
        }else{
          this.topBannerShow = false
        }
      }
    },
    $route (to, from) {
      if (to.path == '/home' && this.topBanner) {
        this.topBannerShow = true
      } else {
        this.topBannerShow = false
      }
    }

  },
  methods: {
    close () {
      this.isPhoneShow = false;
    },
    handleClose (done) {
      done();
    },
    timers () {
      this.timea = setTimeout(() => {
        this.getUserInfo();
      }, 3000);
    },
    getUserInfo () {
      this.$ajax.post("/user/getInfo").then(res => {
        this.userInfo = res.data.data;
        let nowDate = new Date().getTime();
        if (res.data.data.vipEndTime > nowDate) {
          // this.userInfo.vipEndTime = res.data.data.vipEndTime
          this.show = true;
          this.$store.commit("show", true);
          clearTimeout(this.timea);
        } else {
          this.show = false;
          this.$store.commit("show", false);
          this.timers();
        }
        sessionStorage.setItem("info", JSON.stringify(res.data.data));
      });
    },
    vipClick () {
      if (this.loginShow) {
        this.isPhoneShow = false;
        this.$router.push({
          path: "/vip_pay"
        });
      } else {
        this.$confirm("您还没有登录，请先去登录", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.$router.push({
            path: "/userlogin",
            query: {
              vip_path: "/vip_pay"
            }
          });
        });
      }
    },
    handleChange (evl) {
      evl[0] == 1 ? (this.holdall = false) : (this.holdall = true);
    },
    // 开通会员
    openVip () {
      if (this.loginShow) {
        this.$router.push({
          path: "/vip_pay"
        });
      } else {
        this.$confirm("您还没有登录，请先去登录", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.$router.push({
            path: "/userlogin",
            query: {
              vip_path: "/vip_pay"
            }
          });
        });
      }
    },
    // 跳转某一个页面
    goToPage (path) {
      this.isPhoneShow = false;
      this.$router.push(path);
    }
  }
};
</script>

<style lang="scss" scoped>
.nav-item {
  height: 35px;
  display: flex;
  flex-direction: row;
  align-items: center;
  img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
  }
}
.collapse {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding-left: 10px;
  border-top: none !important;
  img {
    flex: 0 1 25px;
    margin-top: 10px;
  }
  .el-collapse-item {
    flex: 1;
    color: #606060;
  }
}
.m-icon {
  width: 25px;
  height: 25px;
  margin-right: 10px;
}
// vip
.vip-box {
  margin-left: 20px;
  cursor: pointer;
}

.vip-date {
  text-align: center;
  font-size: 16px;
}

.vip-wrap {
  width: calc(100% + 2px);
  min-height: 200px;
  background-color: #fff;
  overflow: hidden;
  padding-top: 50px;

  .vip-icon-box {
    width: 100%;
    height: auto;
    margin: 22px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    .vip-icon-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin-right: 27px;

      &:last-child {
        margin-right: 0;
      }

      img {
        width: 40px;
        height: 40px;
      }

      p {
        font-size: 16px;
        color: #4f4f4f;
        margin-top: 10px;
      }
    }
  }
  .vip-btn:hover {
    background: linear-gradient(
      0deg,
      rgba(64, 92, 218, 0.7),
      rgba(134, 166, 242, 0.9)
    );
  }
  .vip-btn {
    cursor: pointer;
    display: block;
    width: 250px;
    height: 50px;
    background: linear-gradient(0deg, #405cda, #86a6f2);
    box-shadow: 0px 6px15px rgba(154, 145, 229, 0.3);
    border-radius: 30px;
    margin: 0 auto 15px;
    text-align: center;
    line-height: 50px;
    font-size: 18px;
    color: #fff;
  }
}

.vip-title {
  position: absolute;
  top: 0;
  transform: translateY(-12px);
  left: -1px;
  right: -1px;
  display: flex;
  align-items: center;
  padding-top: 12px;
  justify-content: center;
  width: calc(100% + 2px);
  font-size: 18px;
  color: #fff;
  height: 75px;
  text-align: center;
  background: url(../assets/images/vip-title-bg.png) top center no-repeat;
  background-size: 100%;
}

.btnGroups {
  display: flex;
  align-items: center;
  padding-left: 20px;
}

li {
  font-size: 14px;
}

#aa {
  position: relative;
}

#aa span {
  position: absolute;
  display: block;
  background: red;
  color: #fff;
  font-size: 12px;
  border-radius: 2px;
  top: 0px;
  right: 5px;
  padding: 2px 4px;
  z-index: 11;
}

.active {
  color: #405cda;
}

.menus {
  display: flex;
  align-items: center;
}

.menus ul {
  display: flex;
}

.menus ul li {
  margin-left: 60px;
  position: relative;
  padding: 0 2px;
  height: 52px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.menus ul li:hover {
  color: #405cda;
}

.menus ul li:hover:after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  content: "";
  background-color: #405cda;
}

.menus ul li:first-child {
  margin-left: 0;
}

.menus ul li.active:after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  transition: 0.3s ease-in;
  content: "";
  background-color: #405cda;
}

.menus ul li a {
  font-size: 14px;
  color: #606060;
}

.menus ul li.active a {
  color: #405cda;
}

.menus .btns {
  display: flex;
  margin-left: 70px;
}

.menus .btns a {
  border-radius: 2px;
  width: 73px;
  height: 35px;
  border: 1px solid #405cda;
  font-size: 14px;
  color: #405cda;
  line-height: 33px;
  text-align: center;
}

.menus .btns a.login {
  margin-right: 7px;
  color: #fff;
  background-color: #405cda;
}

.menus a.link {
  margin-left: 46px;
  font-size: 14px;
  color: #606060;
}

@media (min-width: 750px) and (max-width: 900px) {
  .menus ul li {
    margin-left: 30px;
  }

  .menus .btns {
    margin-left: 30px;
  }

  .menus a.link {
    margin-left: 20px;
  }
}

@media (max-width: 750px) {
  .active {
    color: #405cda !important;
  }

  .top-bar .menu-bar {
    display: block;
  }

  .aa {
    display: none !important;
  }

  .btnGroups {
    padding-left: 0;

    a {
      width: 57px !important;
    }
  }

  .menus {
    padding-top: 10px;
  }

  //  .menus{
  //   display: block;
  //   position: fixed;
  //   top: 0;
  //   left: 0;
  //   width: 100%;
  //   height: 100%;
  //   padding-top: 75px;
  //   background-color: rgba(0, 0, 0, .4);
  //   z-index: 99;
  // }
  .top-bar .phoneShow {
    display: block;
  }

  .menus .links {
    float: right;
    width: 100%;
    height: 100%;
    background-color: #fff;
    // transform: translateX(100%);
    // transition: all .4s;
  }

  .menus.active .links {
    // transform: translateX(0%);
  }

  .menus .links ul {
    display: block;
  }

  .menus .links ul li {
    margin-left: 0;
    padding-left: 20px;
    color: #606060;
    border-bottom: 1px solid #e4e7e9;
  }

  .menus .btns {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    padding: 20px 20px;
    margin-left: 0;
    background-color: #fff;
    z-index: 1;
    border-bottom: 1px solid #ccc;

    // transform: translateX(100%);
    // transition: all .4s;
    .right {
      display: flex;
      align-items: center;

      .l {
        margin-left: 0;
      }
    }
  }

  .topMain {
    .right {
      display: flex;
      align-items: center;

      .l {
        padding-left: 0 !important;
      }
    }
  }

  .menus.active .btns {
    // transform: translateX(0%);
  }

  .menus .link {
    position: absolute;
    right: 20px;
    top: 22px;
    z-index: 2;
  }
}
</style>
<style lang="scss" scoped>
.topMain {
  display: flex;
  align-items: center;
  justify-content: space-between;
  // padding: 0 40px;
  height: 60px;
  margin-left: 0 !important;

  .left {
    font-size: 16px;
    color: #9f9f9f;
  }

  .right {
    display: flex;
    align-items: center;
    cursor: pointer;

    .l {
      height: 60px;
      padding: 0 23px;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1900;
      position: relative;

      img {
        height: 20px;
      }
    }

    .r {
      padding-left: 22px;
      display: flex;
      align-items: center;

      // border-left: 2px solid #bdbdbd;
      .avatar {
        box-shadow: 0 0 10px #bdbebe;
        border-radius: 2px solid #fff;
      }

      i {
        margin-left: 6px;
      }
    }
  }
}
</style>
<style lang="scss">
.userPop {
  padding: 0 !important;
}

#userInfos {
  .el-popover__reference {
    display: flex;
    align-items: center;
  }
}

.topss {
  dl {
    display: flex;
    align-items: center;
    // justify-content: center;
    flex-direction: column;

    dt {
      > div {
        padding: 9px;
        text-align: center;
      }
    }

    dd {
      width: 100%;
      line-height: 44px;
      text-align: center;
      border-top: 1px solid #e9e9e9;
    }
  }

  h4 {
    font-size: 14px;
    line-height: 50px;
    color: #d2d7f4;
    background: #405cda;
    text-align: center;
  }
}

.userPop {
  padding: 0;

  > img {
  }
}

#userTops {
  display: flex;
  align-items: center;
}

#mesBox {
  // position: absolute;
  border-radius: 8px;
  z-index: 999;
  right: 27px;
  top: 66px;
  overflow: hidden;
  width: 278px;

  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
  // position: relative;
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 255, 0.3);

  // padding: 20px;
  .el-scrollbar__wrap {
    overflow-x: hidden !important;
  }

  .aa {
  }

  // .aa:before{
  //     width: 0;
  //     height: 0;
  //     border:9px solid #fff;
  //     border-top-color: transparent;
  //     border-left-color: transparent;
  //     border-right-color: transparent;
  //     display: block;
  //     position: absolute;
  //     content:" .";
  //     top: -18px;
  //     z-index: 999;
  //     left: calc(50% - 9px);
  // }
  h2 {
    height: 50px;
    padding-left: 24px;
    display: flex;
    align-items: center;
    color: #7e7e7e;
    font-weight: normal;
    font-size: 16px;
    line-height: 50px;
    border-bottom: 1px solid #e9e9e9;

    span {
      color: #f28787;
    }
  }

  ul {
    padding: 20px 0;
    padding-top: 0;
    // min-height:50px;
    height: 240px;
    overflow: hidden;

    li {
      margin: 0 25px;
      border-bottom: 1px solid #e9e9e9;
      padding-top: 20px;
      padding-bottom: 10px;
      display: flex;
      align-items: flex-start;

      h3 {
        // font: 14px/24px "";
        font-size: 14px;
        line-height: 24px;
        color: #4e4e4e;
      }

      p {
        // font:12px/20px "";
        font-size: 12px;
        line-height: 20px;
        color: #8b8b8b;
      }

      .listL {
        margin-right: 17px;
      }
    }
  }

  h4 {
    // font:14px/50px "";
    font-size: 14px;
    line-height: 50px;
    color: #d2d7f4;
    background: #405cda;
    text-align: center;
  }
}

.erjicaidan {
  width: 100%;
  background: #fff;
  overflow: hidden;
  position: fixed;
  left: 0;
  top: 56px;
  z-index: 11;
  color: #333;
  box-shadow: 0px 10px 10px 0 #555;
  height: 0;
}

.erjicaidan2 {
  margin-top: 50px;
}

.erjicaidan .icon2 {
  width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  display: block;
  padding: 40px 0;
}

.erjicaidan .icon2 h5 {
  float: left;
  width: 300px;
  margin: 20px auto;
  text-align: center;
  padding: 10px;
}

.erjicaidan .icon2 h5:hover {
  background: #f9f9f9;
}

.erjicaidan .icon2 h5 img {
  width: 100px;
  height: 100px;
}

#aa:hover .erjicaidan {
  height: auto;
}
</style>
